{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import matplotlib.path as mpath\n",
    "import matplotlib.lines as mlines\n",
    "import matplotlib.patches as mpatches\n",
    "from matplotlib.collections import PatchCollection\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# First create some toy data:\n",
    "# x = np.linspace(0, 2*np.pi, 400)\n",
    "# y = np.sin(x**2)\n",
    "\n",
    "# Create just a figure and only one subplot\n",
    "# fig, ax = plt.subplots()     #坐标图\n",
    "# ax.plot(x, y)        # 画直线\n",
    "# ax.set_title('Simple plot')    # 设置名称\n",
    "\n",
    "# # Create two subplots and unpack the output array immediately\n",
    "# f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)   #几行  几列  sharex, sharey控制x与y轴主图与子图之间的共享 ax根据按照行列自动分配几个图就有多少个ax\n",
    "# ax1.plot(x, y)    # 画直线     (只有划分俩个区块的时候，才可以使用元组刑事获取，其他的直接[x,y]去获取如下面例子)\n",
    "# ax1.set_title('Sharing Y axis')\n",
    "# ax2.scatter(x, y)     #画散点  x,y点的位置\n",
    "\n",
    "# # # Create four polar axes and access them through the returned array\n",
    "# fig, axs = plt.subplots(2, 2, subplot_kw=dict(projection=\"polar\")) # 创建坐标图，按照'polar'模型进行绘画\n",
    "# axs[0, 0].scatter(x, y)\n",
    "# axs[1, 1].plot(x, y)   #索引位置是区域的划分\n",
    "\n",
    "# Share a X axis with each column of subplots\n",
    "# fig,ax = plt.subplots(2, 2, sharex='col')  # 创建坐标图并按照行列自动分配  sharex='col' 表示所有表有竖坐标，横坐标共用一个\n",
    "\n",
    "# # Share a Y axis with each row of subplots\n",
    "# plt.subplots(2, 2, sharey='row')   #     sharey='row'   表示所有表有横坐标，横坐标共用一个\n",
    " \n",
    "# # Share both X and Y axes with all subplots\n",
    "# plt.subplots(2, 2, sharex='all', sharey='all')   # sharex='all', sharey='all'  所有表共用一个下x,y坐标\n",
    "\n",
    "# # Note that this is the same as\n",
    "# plt.subplots(2, 2, sharex=True, sharey=True)  # 和上面一样\n",
    "\n",
    "# # Create figure number 10 with a single subplot\n",
    "# # and clears it if it already exists.\n",
    "# fig, ax = plt.subplots(num=10, clear=True)  # num 坐标范围"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "3cb250e525bdc45e0c81f60515e2b301d41451e11e00718716680ec78afef40b"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8rc1 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
